package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.MsAnswersMapper;
import com.education.wisdom.pojo.MsAnswers;
import com.education.wisdom.service.IMsAnswersService;
import com.education.wisdom.vo.MsAnswersVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 答卷 服务层实现
 * 
 * @author ruoyi
 * @date 2018-12-17
 */
@Service
public class MsAnswersServiceImpl implements IMsAnswersService
{
	@Autowired
	private com.education.wisdom.mapper.MsAnswersMapper MsAnswersMapper;

	/**
     * 查询答卷信息
     * 
     * @param id 答卷ID
     * @return 答卷信息
     */
    @Override
	public MsAnswers selectMsAnswersByIds(Map<String,Object> map)
	{
	    return MsAnswersMapper.selectMsAnswersByIds(map);
	}

	/**
	 * 查询答卷信息
	 *
	 * @param id 答卷ID
	 * @return 答卷信息
	 */
	@Override
	public MsAnswers selectMsAnswersById(Integer id)
	{
		return MsAnswersMapper.selectMsAnswersById(id);
	}

    /**
     * 查询答卷列表
     * 
     * @param MsAnswers 答卷信息
     * @return 答卷集合
     */
	@Override
	public List<MsAnswersVo> selectMsAnswersList(MsAnswers MsAnswers)
	{
	    return MsAnswersMapper.selectMsAnswersList(MsAnswers);
	}

	/**
	 * 学习记录查询
	 * @param djUserid 答题者Id
	 * @return
	 */
	@Override
	public List<MsAnswers> selectAnswersByUId(String djUserid) {
		return MsAnswersMapper.selectAnswersByUId(djUserid);
	}

	@Override
	public List<MsAnswers> selectAnswersByPara(Map<String, Object> map) {
		return MsAnswersMapper.selectAnswersByPara(map);
	}


	/**
     * 新增答卷
     * 
     * @param MsAnswers 答卷信息
     * @return 结果
     */
	@Override
	public int insertMsAnswers(MsAnswers MsAnswers)
	{
	    return MsAnswersMapper.insertMsAnswers(MsAnswers);
	}
	
	/**
     * 修改答卷
     * 
     * @param MsAnswers 答卷信息
     * @return 结果
     */
	@Override
	public int updateMsAnswers(MsAnswers MsAnswers)
	{
	    return MsAnswersMapper.updateMsAnswers(MsAnswers);
	}

	/**
     * 删除答卷对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteMsAnswersByIds(String ids)
	{
		return MsAnswersMapper.deleteMsAnswersByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<MsAnswersVo> selectMsAnswersStuList(String userId) {
		return MsAnswersMapper.selectMsAnswersStuList(userId);
	}

	@Override
	public List<MsAnswersVo> selectMsAnswersAllStuList() {
		return MsAnswersMapper.selectMsAnswersAllStuList();
	}
	
}
